Sequential video images are generally encoded by video compression processes in one of two ways. One way is for each image in the sequence to be encoded by itself, as a stand alone or still image. This process is referred to as an intra-encoding compression process, because the encoding algorithm operates only on features within the target image. Another way of performing video compression, called temporal prediction encoding, is for a given image to be encoded by predicting the motion of a target image based on another, previously encoded reference image. This process is also referred to as inter-encoding, because the prediction is generated from an inter-relationship between a target image and a reference image.
During the temporal prediction encoding process, the target image and the reference image are divided into blocks. If a block in the target image is similar to a block in a reference image, then the spatial displacement, or motion, of the block from its location in the reference image to its location in the target image is determined. This displacement information is stored in a motion vector which associates the reference block with the target block. The encoded image data from the reference block provides a prediction of the image data for the target block.
Although image data for most of the target blocks in the target image can be predicted by the temporal predictive method, some of the target blocks may not be predicted very well by this method. For example, a block in the target image may not be similar to a block in the reference image. In this case, the intra-encoding process is used to encode the target block, without relying on any of the reference images.
FIG. 1 shows an example of a target image that is encoded using both temporal prediction (or inter-encoding) and intra-encoding methods. A target block 125 in target image 120 is matched to a similar block 115 in reference image 110 using motion vector 130. The image data for the target block 125 is then predicted during a decoding process from the image data in the target block 115. The target block 125 is therefore efficiently encoded by the temporal prediction method.
However, target block 140 cannot be encoded by the temporal prediction method, because it has no counterpart in reference image 110. Target block 140 should therefore be encoded by the intra-block encoding method.
Some blocks are encoded better with a temporal prediction method, and others are encoded better with an intra-encoding method. When using both temporal prediction and intra-encoding methods to encode an image, the encoder has to decide whether to use a temporal prediction or an intra-encoding method for each block. However, since the traditional temporal prediction and intra-encoding methods produce different results, their respective encoded blocks are too different to compare when making this decision.
For example, when encoding a target block, typical video compression algorithms use the decision system 200 shown in FIG. 2 to decide whether to apply a temporal prediction or an intra-encoding method for that block. Target block 210 is encoded by temporal prediction logic device 220, which applies the temporal prediction encoding method. The logic device 220 determines a motion vector 230 to map encoded image data from a reference block to the target block 210. The temporal prediction logic 220 also calculates a prediction error 240 between the prediction of the image data for the target block, and the actual image data for the target block. The bit cost estimation logic device 250 estimates the bit cost for the motion vector 230, as well as the bit cost of the prediction error 240, to produce a bit cost for the temporal encoding of target block 210.
The decision system 200 also encodes the target block 210 using an intra-encoding process. The intra-encoding logic device 260 applies a discrete cosine transform (DCT) to original pixel values in the target block, to produce a set of DCT coefficients 270. Intra-block bit cost estimation logic device 280 estimates the bit cost of encoding the DCT coefficients. Bit cost selection logic device 290 compares the bit costs produced by logic devices 250 and 280, and selects the encoding process that has the lower bit cost.
As shown in FIG. 2, the temporal prediction process produces a motion vector and a prediction error, and the intra-encoding method produces a set of DCT coefficients. In order to compare the two, the decision system has to perform two encoding processes and then estimate the bit cost of the encoded results from each process before it can identify the process that produces a result with a lower bit cost. A problem, therefore, is that the decision system is unable to determine which particular encoding process provides a better cost benefit without estimating the bit costs of the entire results of both processes.